<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Generator" content="ECSHOP v2.7.3" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" />
<meta name="Description" content="<?php echo $this->_var['description']; ?>" />

<title><?php echo $this->_var['page_title']; ?></title>

<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="animated_favicon.gif" type="image/gif" />
<style type="text/css">
<!--
body {
  margin-left: 0px;
  margin-top: 0px;
  margin-right: 0px;
  margin-bottom: 0px;
}
-->
</style>
<link href="themes/puke/css/css.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" />
<style type="text/css">
p.year{margin-left: 0;}
p.year a{padding: 5px 7px;}
a:hover{text-decoration: none;}
</style>
</head>

<body onload="MM_preloadImages('themes/puke/images/danghangb1.jpg','themes/puke/images/danghangb2.jpg','themes/puke/images/danghangb3.jpg','themes/puke/images/danghangb4.jpg','themes/puke/images/danghangb5.jpg')">
<?php echo $this->fetch('library/page_header.lbi'); ?>
<?php echo $this->smarty_insert_scripts(array('files'=>'jquery-1.9.1.min.js,common.js,transport.js,jquery.json.js')); ?>
<script type="text/javascript">
  function show_goods(id) {
    //jQuery('.theme-popover-mask').fadeIn(2000);
    jQuery('.theme-popover-mask').show();
    $('.theme-popover-mask').height($(document).height());
    $('#goods_detail'+id).fadeIn(2000);
    document.forms['ECS_FORMBUY'+id].reset();
    // jQuery("#year"+id).find("a").removeClass("on");
    // jQuery("#year"+id+">a:first-child").addClass("on");
    changePrice(id);
  }
  function close_goods(id){
    //$('.theme-popover-mask').fadeOut(2000);
    //$('#goods_detail'+id).fadeOut(2000);
    $('#goods_detail'+id).hide();
    jQuery('.theme-popover-mask').hide();
  }

</script>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="9"></td>
  </tr>
</table>
<table width="962" border="0" align="center" cellpadding="0" cellspacing="0" class="bian">
  <tr>
    <td width="960" height="1561" align="center" valign="top"><table width="960" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="37" align="left" bgcolor="#F4F4F4" style="background:url(themes/ecmoban_yesmywine/images/aas1.jpg) no-repeat #f4f4f4;width:321px;height:38px;text-indent:150px;font-size:24px;">商品搜索_<?php echo $this->_var['keywords']; ?></td>
          </tr>
        </table>
        <table width="960" border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td height="8" colspan="3" align="center" valign="middle"></td>
          </tr>
          <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');$this->_foreach['goods'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['goods']['total'] > 0):
    foreach ($_from AS $this->_var['goods']):
        $this->_foreach['goods']['iteration']++;
?>
          <?php if (($this->_foreach['goods']['iteration'] - 1) % 2 == 0): ?><tr><?php endif; ?>
            <td width="465" align="center" valign="middle">
              <table width="460" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="30" align="left" valign="middle" class="ziti1"><?php echo $this->_var['goods']['goods_name']; ?></td>
                </tr>
                <tr>
                  <td height="195" align="center" valign="middle">
                    <table width="460" border="0" cellpadding="0" cellspacing="0" class="bian">
                      <tr>
                        <td width="195" height="195" align="center" valign="middle" style="padding:5px 0;">
                          <img src="<?php echo $this->_var['goods']['goods_thumb']; ?>" <?php if ($this->_var['goods']['seller_note'] == ''): ?>onclick="show_goods(<?php echo $this->_var['goods']['goods_id']; ?>)"<?php endif; ?> class="bigtimg" />
                        </td>
                        <td width="230" align="center">
                          <table height="98" border="0" cellpadding="0" cellspacing="0" class="ziti2">
                            <tr>
                              <td height="98"><?php echo $this->_var['goods']['goods_brief']; ?></td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr>
                  <td height="24" align="right" valign="middle"><a href="<?php echo $this->_var['goods']['url']; ?>"><?php if ($this->_var['goods']['seller_note'] == ''): ?>详文及购买<?php else: ?>查看更多<?php endif; ?> </a></td>
                </tr>
              </table>
              
              <table class="theme-popover" id="goods_detail<?php echo $this->_var['goods']['goods_id']; ?>" width="1017" height="504" border="0" align="center" cellpadding="0" cellspacing="0" background="themes/ecmoban_yesmywine/images/di2.png" style="display:none;">
                <tr>
                  <td width="988" height="454" align="center" valign="middle">
                  <table width="970" height="460" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                    <td width="440" rowspan="2" align="center" valign="middle"><img src="<?php echo $this->_var['goods']['goods_img']; ?>" width="440" height="440" /></td>
                    <td width="485" height="27" align="right" onclick="close_goods(<?php echo $this->_var['goods']['goods_id']; ?>)"><img src="themes/ecmoban_yesmywine/images/x.jpg" width="21" height="21" /></td>
                    <td width="45" align="center" class="guanbi STYLE1" onclick="close_goods(<?php echo $this->_var['goods']['goods_id']; ?>)">关闭</td>
                    </tr>
                    <tr>
                    <td height="427" colspan="2" align="center" valign="middle">
                      <table width="513" height="44" border="0" cellpadding="0" cellspacing="0" class="bian2s">
                      <tr>
                        <td width="501" height="44" colspan="3" align="left" class="zi13"><?php echo $this->_var['goods']['name']; ?><span style="float:right;font-size:14px;"><a href="<?php echo $this->_var['goods']['url']; ?>">详文及购买</a></span></td>
                      </tr>
                      </table>
                      <table width="513" height="382" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                        <td height="251" colspan="3" align="left"><span class="zitis"><?php echo $this->_var['goods']['goods_brief']; ?></span></td>
                        </tr>
                        <tr>
                        <td width="501" height="131" colspan="3" align="left" valign="bottom">
                          <form action="javascript:addToCart_index(<?php echo $this->_var['goods']['goods_id']; ?>)" method="post" name="ECS_FORMBUY<?php echo $this->_var['goods']['goods_id']; ?>" id="ECS_FORMBUY<?php echo $this->_var['goods']['goods_id']; ?>" >
                            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                              <tr>
                                <td>
                                  
                                  <?php $_from = $this->_var['goods']['specification']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('spec_key', 'spec');if (count($_from)):
    foreach ($_from AS $this->_var['spec_key'] => $this->_var['spec']):
?>
                                  <?php if ($this->_var['spec']['name'] == '年份'): ?>
                                  <div>
                                    <?php if ($this->_var['spec']['attr_type'] == 1): ?>
                                    <p class="year">
                                      <select name="spec_<?php echo $this->_var['spec_key']; ?>" onchange="changePrice(<?php echo $this->_var['goods']['goods_id']; ?>)" style="width:70px;">
                                        <?php $_from = $this->_var['spec']['values']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['value']):
?>
                                        <option label="<?php echo $this->_var['value']['label']; ?>" value="<?php echo $this->_var['value']['id']; ?>"><?php echo $this->_var['value']['label']; ?></option>
                                        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                      </select>
                                    </p>
                                    <input type="hidden" name="spec_list" value="<?php echo $this->_var['key']; ?>" />
                                    <?php else: ?>
                                    <p class="year">
                                      <?php $_from = $this->_var['spec']['values']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['value']):
?>
                                      <a onclick="changeAtt(this,<?php echo $this->_var['goods']['id']; ?>)"  href="javascript:;" name="<?php echo $this->_var['value']['id']; ?>"><ins></ins><?php echo $this->_var['value']['label']; ?>
                                      <input type="checkbox" style="display:none"  name="spec_<?php echo $this->_var['spec_key']; ?>"  value="<?php echo $this->_var['value']['id']; ?>"  id="spec_value_<?php echo $this->_var['value']['id']; ?>" /></a>
                                      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                    </p>
                                    <input type="hidden" name="spec_list" value="<?php echo $this->_var['key']; ?>" />
                                    <?php endif; ?>
                                  </div>
                                  <?php endif; ?>
                                  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                  
                                </td>
                                <td>
                                  
                                  <?php $_from = $this->_var['goods']['specification']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('spec_key', 'spec');if (count($_from)):
    foreach ($_from AS $this->_var['spec_key'] => $this->_var['spec']):
?>
                                  <?php if ($this->_var['spec']['name'] != '年份'): ?>
                                  <div>
                                    <?php if ($this->_var['spec']['attr_type'] == 1): ?>
                                    <p class="year" id="year<?php echo $this->_var['goods']['goods_id']; ?>">
                                      <?php $_from = $this->_var['spec']['values']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['value']):
?>
                                      <a <?php if ($this->_var['key'] == 0): ?>class="on"<?php endif; ?> onclick="changeAtt(this,<?php echo $this->_var['goods']['goods_id']; ?>)" href="javascript:;" name="<?php echo $this->_var['value']['id']; ?>"><ins></ins><?php echo $this->_var['value']['label']; ?>
                                      <input style="display:none" id="spec_value_<?php echo $this->_var['value']['id']; ?>" type="radio" name="spec_<?php echo $this->_var['spec_key']; ?>" value="<?php echo $this->_var['value']['id']; ?>" <?php if ($this->_var['key'] == 0): ?>checked<?php endif; ?> /></a>
                                      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                    </p>
                                    <input type="hidden" name="spec_list" value="<?php echo $this->_var['key']; ?>" />
                                    <?php else: ?>
                                    <p class="year" id="year<?php echo $this->_var['goods']['goods_id']; ?>">
                                      <?php $_from = $this->_var['spec']['values']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'value');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['value']):
?>
                                      <a onclick="changeAtt(this,<?php echo $this->_var['goods']['goods_id']; ?>)"  href="javascript:;" name="<?php echo $this->_var['value']['id']; ?>"><ins></ins><?php echo $this->_var['value']['label']; ?>
                                      <input type="checkbox" style="display:none"  name="spec_<?php echo $this->_var['spec_key']; ?>"  value="<?php echo $this->_var['value']['id']; ?>"  id="spec_value_<?php echo $this->_var['value']['id']; ?>" /></a>
                                      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                    </p>
                                    <input type="hidden" name="spec_list" value="<?php echo $this->_var['key']; ?>" />
                                    <?php endif; ?>
                                  </div>
                                  <?php endif; ?>
                                  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                  
                                </td>
                                <td style="color:#B63547;font-size:20px;"><span id="SHOP_PRICE<?php echo $this->_var['goods']['goods_id']; ?>"><?php echo $this->_var['goods']['shop_price']; ?></span></td>
                                <td>购买数量：<input type="text" name="goods_number" value="1" id="goods_number<?php echo $this->_var['goods']['goods_id']; ?>" size="4" onblur="changePrice(<?php echo $this->_var['goods']['goods_id']; ?>)"></td>
                                <td><a href="javascript:addToCart_index(<?php echo $this->_var['goods']['goods_id']; ?>);" style="background:url(themes/ecmoban_yesmywine/images/tuiche.jpg) no-repeat;width:71px;height:65px;display:block;">&nbsp;</a></td>
                              </tr>
                              <!-- <tr><td colspan="2">&nbsp;</td></tr>
                              <tr>
                                <td colspan="2"><a href="javascript:addToCart_index(<?php echo $this->_var['goods']['id']; ?>);" style="background:url(themes/puke/images/cart.jpg) no-repeat;width:162px;height:44px;display:block;">&nbsp;</a></td>
                              </tr> -->
                            </table>
                          </form>
                        </td>
                        </tr>
                      </table>
                    </td>
                    </tr>
                  </table>
                </td>
                </tr>
              </table>
              
            </td>
          <?php if ($this->_foreach['goods']['iteration'] % 2 == 0 || ($this->_foreach['goods']['iteration'] == $this->_foreach['goods']['total'])): ?></tr><?php endif; ?>
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </table>
        <script type="text/javascript">
        
        /**
         * 点选可选属性或改变数量时修改商品价格的函数
         */
        function changePrice(id)
        {
          var attr = getSelectedAttributes(document.forms['ECS_FORMBUY'+id]);
         
          var qty = document.forms['ECS_FORMBUY'+id].elements['goods_number'].value;

          Ajax.call('index.php', 'act=price&id=' + id + '&attr=' + attr + '&number=' + qty, changePriceResponse, 'GET', 'JSON');
        }


        /**
         * 接收返回的信息
         */
        function changePriceResponse(res)
        {
          if (res.err_msg.length > 0)
          {
            alert(res.err_msg);
          }
          else
          {
            id = res.goods_id;
            document.forms['ECS_FORMBUY'+id].elements['goods_number'].value = res.qty;

            if (document.getElementById('ECS_GOODS_AMOUNT'))
              document.getElementById('ECS_GOODS_AMOUNT').innerHTML = res.result;
            
             if (document.getElementById('SHOP_PRICE'+id))
              document.getElementById('SHOP_PRICE'+id).innerHTML = res.result;
          }
        }

        function changeAtt(t,id) {
          t.lastChild.checked='checked';
          for (var i = 0; i<t.parentNode.childNodes.length;i++) {
              if (t.parentNode.childNodes[i].className == 'on') {
                t.parentNode.childNodes[i].className = '';
              }
            }
          t.className = "on";
          changePrice(id);
        }
        
        </script>
        <table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td align="center">
              <?php echo $this->fetch('library/pages.lbi'); ?>
            </td>
          </tr>
        </table>
        <table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table></td>
  </tr>
</table>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>


<div class="theme-popover-mask"></div>


<?php echo $this->fetch('library/page_footer.lbi'); ?>
</body>
</html>
